package com.wc.blue_bridge_test.base.T57;


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/12/29 11:05
 * @description 分解质因数
 * https://lx.lanqiao.cn/problem.page?gpid=T57
 */
public class Main {
    static int maxN = (int) 1e5;
    static boolean[] isNotPrime = new boolean[maxN + 1];
    static int idx = 0;
    static int[] primes = new int[maxN];
    static ArrayList<ArrayList<Integer>> ans = new ArrayList<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ola(maxN);
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 2; i <= b; i++) {
            ArrayList<Integer> curArr = new ArrayList<>();
            cal(i, curArr);
            Collections.sort(curArr);
            ans.add(curArr);
        }
        for (int i = a; i <= b; i++) {
            ArrayList<Integer> row = ans.get(i - 2);
            print(i, row);
        }
    }

    public static void print(int i, ArrayList<Integer> row) {
        int len = row.size();
        StringBuffer ans = new StringBuffer();
        ans.append(i);
        ans.append('=');
        ans.append(row.get(0));
        for (int j = 1; j < len; j++) {
            ans.append('*');
            ans.append(row.get(j));
        }
        System.out.println(ans);
    }

    public static void cal(int n, ArrayList<Integer> curNum) {
        if (n == 1) {
            return;
        }
        if (ans.size() > n - 2) {
            curNum.addAll(ans.get(n - 2));
            return;
        }
        for (int i = 2; i <= n; i++) {
            if (n % i == 0) {
                if (!isNotPrime[i]) {
                    curNum.add(i);
                    cal(n / i, curNum);
                    return;
                } else if (!isNotPrime[n / i]) {
                    curNum.add(n / i);
                    cal(i, curNum);
                    return;
                }

            }
        }
    }

    public static void ola(int x) {
        isNotPrime[0] = isNotPrime[1] = true;
        for (int i = 2; i <= x; i++) {
            if (!isNotPrime[i]) {
                primes[++idx] = i;
            }
            for (int j = 1; primes[j] * i <= x; j++) {
                isNotPrime[primes[j] * i] = true;

                if (i % primes[j] == 0) {
                    break;
                }
            }
        }
    }
}
